package io.sk.interceptor;

import io.sk.common.utils.DateConvertEditor;
import org.springframework.web.bind.WebDataBinder;
import org.springframework.web.bind.support.WebBindingInitializer;

import java.util.Date;

/**
 * 自定义WebBindingInitializer
 *
 * @author xubinren
 * @version 1.0
 * @date 2018/5/9 15:14
 */
public class MyWebBinding implements WebBindingInitializer {

    @Override
    public void initBinder(WebDataBinder binder) {
        //2. 自定义的PropertyEditorSupport
        binder.registerCustomEditor(Date.class, new DateConvertEditor());
    }

}
